﻿using rmTest.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProgramTest
{
    public static class InitData
    {
        public static List<PersonAction> PersonActions = new List<PersonAction>();
        static InitData()
        {
            if (PersonActions.Count == 0)
            {
                PersonAction[] tempClass = JsonUtil.DecodeFile<PersonAction[]>(AppDomain.CurrentDomain.BaseDirectory + "/Resource/StoryDatas.json");
                if (tempClass != null)
                    PersonActions = tempClass.ToList();

                //Dictionary<int, string> keyValues = new Dictionary<int, string>();
                //keyValues.Add(1, "丐帮帮主");
                //keyValues.Add(2, "契丹人");
                //keyValues.Add(3, "南院大王");
                //keyValues.Add(4, "挂印离开");
                //keyValues.Add(5, "悬崖勇退辽兵");
                //PersonActions.Add(new PersonAction("乔峰", keyValues));

                //keyValues = new Dictionary<int, string>();
                //keyValues.Add(1, "小和尚");
                //keyValues.Add(2, "逍遥掌门");
                //keyValues.Add(3, "灵鹫宫宫主");
                //keyValues.Add(4, "西夏驸马");
                //keyValues.Add(5, "悬崖勇退辽兵");
                //PersonActions.Add(new PersonAction("虚竹", keyValues));

                //keyValues = new Dictionary<int, string>();
                //keyValues.Add(1, "钟灵儿");
                //keyValues.Add(2, "木婉清");
                //keyValues.Add(3, "王语嫣");
                //keyValues.Add(4, "大理国王");
                //keyValues.Add(5, "悬崖勇退辽兵");
                //PersonActions.Add(new PersonAction("段誉", keyValues));
            }
        }
    }

    public class TempClass
    {
        public PersonAction[] PersonActions { get; set; }
    }

    public class PersonAction
    {
        public PersonAction() { }
        public PersonAction(string name, string[] actions)
        {
            this.Name = name;
            this.Actions = actions;
        }
        public string Name { get; set; }
        public ConsoleColor Color { get; set; }
        public string[] Actions { get; set; }
    }
}
